package com.nuedu.corejava.ch6.homework;

public class Point {
	public Point() {
		super();
	}

	public Point(int x0, int y0) {
		super();
		this.x = x0;
		this.y = y0;
	}

	private int x;
	private int y;
	public void movePoint(int dx,int dy){
		System.out.println("移动前的位置为"+x+","+y);
		x+=dx;
		y+=dy;
		System.out.println("移动后的位置为"+x+"，"+y);
	}
	public static void main(String[] args) {
		Point p1=new Point();
		Point p2=new Point(5,4);
		p1.x=1;
		p1.y=2;
		p1.movePoint(2, 3);
		p2.movePoint(0, 3);
	}
	
}
